import requests


def send(url, message, mention_all=False):
    """通知企业微信"""

    data = {
        "msgtype": "text",
        "text": {
            "content": message,
        },
    }

    if mention_all:
        data["text"]["mentioned_list"] = ["@all"]

    proxies = {"http": "http://localhost:8888", "https": "http://localhost:8888"}
    requests.post(url, json=data, proxies=proxies, verify=False)
